﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main.aspx.cs" Inherits="AppBox.main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>首页</title>

    <script src="res/js/main.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" AutoSizePanelID="regionPanel" HideScrollbar="true"
        runat="server" />
    <ext:RegionPanel ID="regionPanel" ShowBorder="false" runat="server">
        <Regions>
            <ext:Region ID="regionTop" Height="60px" ShowBorder="false" ShowHeader="false" Position="Top"
                Layout="Fit" runat="server">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
                        <Items>
                            <ext:ToolbarText ID="txtUser" runat="server">
                            </ext:ToolbarText>
                            <ext:ToolbarSeparator />
                            <ext:ToolbarText ID="txtOnlineUserCount" runat="server">
                            </ext:ToolbarText>
                            <ext:ToolbarSeparator />
                            <ext:ToolbarText ID="txtCurrentTime" runat="server">
                            </ext:ToolbarText>
                            <ext:ToolbarFill />
                            <ext:Button ID="btnShowHideHeader" runat="server" Icon="BulletArrowUp" ToolTip="隐藏标题栏"
                                EnablePostBack="false">
                            </ext:Button>
                            <ext:Button ID="btnRefresh" Hidden="true" runat="server" Icon="Reload" ToolTip="刷新主区域内容" EnablePostBack="false">
                            </ext:Button>
                            <ext:ToolbarSeparator />
                            <ext:Button ID="btnHelp" EnablePostBack="false" Icon="Help" Text="帮助" runat="server">
                            </ext:Button>
                            <ext:ToolbarSeparator />
                            <ext:Button ID="btnExit" runat="server" Icon="UserRed" Text="安全退出" ConfirmText="确定退出系统？"
                                OnClick="btnExit_Click">
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
                <Items>
                    <ext:ContentPanel ShowBorder="false" ShowHeader="false" BodyStyle="background-color:#1C3E7E;"
                        ID="ContentPanel1" runat="server">
                        <div style="font-size: 20px; color:White; font-weight:bold; padding: 5px 10px; ">
                            <a href="./main.aspx" style="color:White;"><%= AppBox.XConfigHelper.Title %></a>
                        </div>
                    </ext:ContentPanel>
                </Items>
            </ext:Region>
            <ext:Region ID="regionLeft" Split="true" EnableSplitTip="true" CollapseMode="Mini"
                Icon="Outline" EnableCollapse="false" EnableLargeHeader="false" Width="200px"
                ShowHeader="true" Title="系统菜单" Layout="Fit" Position="Left" runat="server">
                <Items>
                    <ext:Tree runat="server" EnableArrows="true" ShowBorder="false" ShowHeader="false"
                        AutoScroll="true" ID="treeMenu">
                    </ext:Tree>
                </Items>
            </ext:Region>
            <ext:Region ID="mainRegion" ShowHeader="false" Layout="Fit" Margins="0 0 0 0" Position="Center"
                runat="server">
                <Items>
                    <ext:TabStrip ID="mainTabStrip" EnableTabCloseMenu="true" ShowBorder="false" runat="server">
                        <Tabs>
                            <ext:Tab ID="Tab1" Title="首页" EnableIFrame="true" IFrameUrl="~/admin/default.aspx"
                                Icon="House" runat="server">
                            </ext:Tab>
                        </Tabs>
                    </ext:TabStrip>
                </Items>
            </ext:Region>
        </Regions>
    </ext:RegionPanel>
    <ext:Window ID="Window1" runat="server" IsModal="true" Hidden="true" EnableIFrame="true"
        IFrameUrl="about:blank" Width="600px" Height="400px">
    </ext:Window>
    </form>

    <script type="text/javascript">
        function onReady() {

            window.NODES = {
                'treeMenu': Ext.getCmp('<%= treeMenu.ClientID %>'),
                'regionPanel': Ext.getCmp('<%= regionPanel.ClientID %>'),
                'regionTop': Ext.getCmp('<%= regionTop.ClientID %>'),
                'btnShowHideHeader': Ext.getCmp('<%= btnShowHideHeader.ClientID %>'),
                'mainTabStrip': Ext.getCmp('<%= mainTabStrip.ClientID %>'),
                'txtUser': Ext.getCmp('<%= txtUser.ClientID %>'),
                'txtOnlineUserCount': Ext.getCmp('<%= txtOnlineUserCount.ClientID %>'),
                'txtCurrentTime': Ext.getCmp('<%= txtCurrentTime.ClientID %>'),
                'btnRefresh': Ext.getCmp('<%= btnRefresh.ClientID %>')
            };

            init({
                'userName': '<%= User.Identity.Name %>',
                'userIP': '<%= Request.UserHostAddress %>',
                'onlineUserCount': <%= GetOnlineCount() %>,
                'showHeaderIconUrl': '<%= IconHelper.GetIconUrl(Icon.BulletArrowDown) %>',
                'hideHeaderIconUrl': '<%= IconHelper.GetIconUrl(Icon.BulletArrowUp) %>'
            });

        }
    </script>

</body>
</html>
